package main;

import java.util.List;

import dao.FileIO;

public class BatchRandomSampling {
	
	public static void main(String[] args) {
		if(args.length != 2) {
			return;
		}
		
		String filename = args[0];
		int n = Integer.parseInt(args[1]);
		List<String> lines = FileIO.readFile(filename);
		
		RandomSampling rs = new RandomSampling();
		
		for(String line : lines) {
			String [] tokens = line.split("(\\s|\\t)+");
			String input = tokens[0];
			String positive = tokens[1];
			String negative = tokens[2];
			
			System.out.println(input + "\t" + positive + "\t" + n);
			rs.proceed(input, positive, n, "positive_random");
			System.out.println(input + "\t" + negative + "\t" + n);
			rs.proceed(input, negative, n, "negative_random");
		}
	}
}
